// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.core.skinnedmodel.advancedanimation;

import zombie.util.StringUtils;

public final class AnimationVariableSlotBool extends AnimationVariableSlot {
    private boolean m_value;

    public AnimationVariableSlotBool(String key) {
        super(key);
    }

    @Override
    public String getValueString() {
        return this.m_value ? "true" : "false";
    }

    @Override
    public float getValueFloat() {
        return this.m_value ? 1.0F : 0.0F;
    }

    @Override
    public boolean getValueBool() {
        return this.m_value;
    }

    @Override
    public void setValue(String val) {
        this.m_value = StringUtils.tryParseBoolean(val);
    }

    @Override
    public void setValue(float val) {
        this.m_value = (double)val != 0.0;
    }

    @Override
    public void setValue(boolean val) {
        this.m_value = val;
    }

    @Override
    public AnimationVariableType getType() {
        return AnimationVariableType.Boolean;
    }

    @Override
    public boolean canConvertFrom(String val) {
        return StringUtils.isBoolean(val);
    }

    @Override
    public void clear() {
        this.m_value = false;
    }
}
